package com.atguigu.yygh.hosp.controller.admin;

import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.result.R;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2025/3/18 1:22
 */
@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;
    //根据医院编号获取科室列表
    @GetMapping("getDeptList/{hoscode}")
    public R getDepartmentList(@PathVariable("hoscode") String hoscode) {

        List<DepartmentVo> deptList =departmentService.getDeptList(hoscode);
        return R.ok().data("list",deptList);
    }
}
